package codingforgreat.lchot150;

public class Lc055 {
    public boolean canJump(int[] nums) {
        int cur = 0;
        int next = 0;
        int step = 0;
        for(int i = 0;i < nums.length - 1;i++){

            next = Math.max(next,i + nums[i]);
            if(next <= i){
                return false;
            }
        }
        return next >= nums.length - 1;

    }
}
